package ldh.im.dto.codec.binery;

import ldh.im.ImCoder;
import ldh.im.dto.base.Dto;

/**
 * 数据传输基础类
 * @param <T> T 传输编码
 *
 */
public class TransferCode<T extends Dto, D> {

    private ImCoder<T, D> imCoder;
    private short code;              // 编码类型， 二进制编码时，一个对象有一个编码对应一个编码类型

    public TransferCode(ImCoder<T, D> imCoder, short code) {
        this.imCoder = imCoder;
        this.code = code;
    }

    public ImCoder<T, D> getImCoder() {
        return imCoder;
    }

    public void setImCoder(ImCoder<T, D> imCoder) {
        this.imCoder = imCoder;
    }

    public short getCode() {
        return code;
    }

    public void setCode(short code) {
        this.code = code;
    }
}
